package com.tesco.controller;

import com.tesco.utils.FileHelper;
import com.tesco.utils.WebApiResult;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @Author:jc
 * @Date:2022/1/25 16:49
 * @Description:com.tesco.controller
 */
@Api(tags = "文件模块")
@RequestMapping("/ygfile")
@RestController
@CrossOrigin(origins = "*")
public class FileUtilController {

    @ApiOperation("根据类型获取图片")
    @GetMapping("/filePicture")
    public WebApiResult<List<String>> filePicture(String fileType){
        List<String> list = FileHelper.randomPicture(fileType);
        return WebApiResult.ok(list);
    }
}
